package server.business.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import server.business.pojo.Patient;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

/**
* @author Galaxy
* @description 针对表【patient】的数据库操作Mapper
* @createDate 2022-11-08 12:46:24
* @Entity server.business.pojo.Patient
*/
@Mapper
//@CacheNamespace(implementation = MybatisPlusRedisCache.class)
public interface PatientMapper extends BaseMapper<Patient> {

    /**
     * 根据病例号查找病人
     * @param medicalRecordNumber
     * @return
     */
    @Select("select * from patient where medical_record_number = #{medicalRecordNumber}")
    Patient selectByMedicalRecordNumber(String medicalRecordNumber);

    /**
     * 根据id查找病人
     * @param id
     * @return
     */
    @Select("select * from patient where id = #{id}")
    Patient selectById(Long id);

    /**
     * 根据患者姓名查找病人
     * @param name
     * @return
     */
    @Select("select * from patient where name = #{name}")
    Patient selectByName(String name);


    /**
     *  myq
     * @param medicalRecordNumber
     * @return
     */
    Long selectPatientIdByMed(String medicalRecordNumber);

}




